﻿<!DOCTYPE html>
<html>
<head>
   <title>Creating a Simulation Under Windows</title>
   <meta name="generator" content="Help & Manual">
   <meta name="keywords" content="">
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link type="text/css" href="default.css" rel="stylesheet">
   <link type="text/css" href="custom.css" rel="stylesheet">
   <script type="text/javascript" src="nsh.js"></script>
   
<!-- non-scrolling headers for CHM and browser-based help, local styles-->
<style TYPE="text/css" media="screen"> 
   <!-- 
   body {    
      margin:0; 
      padding:0; 
      overflow: auto; 
      background: #edede9; 
   } 
   #idheader { 
      width:100%; 
      height:auto; 
      padding: 0; 
      margin: 0;     
} 
    #idheaderbg  {
    background: #E40A00; 
}
#idheadernowrap  {
    white-space:nowrap; 
}
    ul {list-style-type: lower-roman}
   -->
   </style>
   
<style TYPE="text/css" MEDIA="print">
<!--
/* Hide navigation links and add space between header
     and text in the printed version. Not valid for eBooks. */
#idnav { display:none;	 }
.topichead { padding: 5px 5px 20px 5px; }
-->
</style>   
   <script type="text/javascript" src="jquery.js"></script>
   <script type="text/javascript" src="helpman_settings.js"></script>
   <script type="text/javascript" src="helpman_topicinit.js"></script>

   <script type="text/javascript">
     HMSyncTOC("index.html", "drvsim_inst_creating_a_simulation_under_wi.htm");
   </script>
   <script type="text/javascript" src="highlight.js"></script>
   <script type="text/javascript">
     $(document).ready(function(){highlight();});
   </script>
</head>
<body>

<!--ZOOMSTOP-->

<div id="idheader" >
<div id="idheaderbg">
<table width="100%" border="0" cellspacing="0" cellpadding="0" 
       style="margin: 0px; color: #D7D7D7;">

  <tr valign="middle">
    <td align="left" valign="middle" class="topichead">
    <!--<div id="idheadernowrap">-->
    <p class="crumbs" id="idnav"><b>Navigation:</b>&nbsp;
   
   VI-DriveSim 19.2 on Windows &gt; VI-DriveSim 19.2 Tutorials &gt; Creating A Simulation With VI-DriveSim 19.2 on Windows&nbsp;&gt;</p>
      <h1 class="p_Heading1" style="page-break-after: avoid;"><span class="f_Heading1">Creating a Simulation Under Windows</span></h1>

    <!--</div>-->
    </td>
    <td align="right" width="180" valign="middle" class="topichead" id="idnav">
    <div id="idheadernowrap">
    <a href="javascript: print();"
    		onmouseover="document.images.prntr.src='print_a.png'" 
        onmouseout="document.images.prntr.src='print_n.png'"
        ><img name="prntr" border="0" alt="Print this Topic" title="Print this Topic" src="print_n.png"
        ></a>&nbsp;&nbsp;
     <a href="drvsim_inst_logitech_fanatec_steering_syst.htm"
        onmouseover="document.images.prev.src='back_a.png'" 
        onmouseout="document.images.prev.src='back_n.png'"
        ><img name=prev src="back_n.png" border=0 alt="Previous page"
        ></a><a href="drvsim_i_simwb_inst.htm"
        onmouseover="document.images.main.src='top_a.png'" 
        onmouseout="document.images.main.src='top_n.png'"><img name=main src="top_n.png" border=0 alt="Return to chapter overview"
        ></a><a href="drvsim_inst_run_configuration__phase_steer.htm"
        onmouseover="document.images.next.src='next_a.png'" 
        onmouseout="document.images.next.src='next_n.png'"><img name=next src="next_n.png" border=0 alt="Next page"
        ></a>
    </div>
    </td>
  </tr>
</table>
</div>

<!-- The following code displays Expand All/Collapse All links  below the header in topics containing toggles -->
  

</div>  



<div id="idcontent"><div id="innerdiv"> 
<!--ZOOMRESTART-->
<p style="margin: 0px 0px 0px 24px;">In this tutorial, the steps needed to create a simulation on VI-DriveSim for Windows are shown. </p>
<p style="margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p style="margin: 0px 0px 0px 24px;">Make a copy of one of the <span style="font-weight: bold;">drvsim_*.bat</span> files present in the <span style="font-weight: bold;">C:/VI-grade/VI-DriveSim 19/standalone</span> directory. As an example, <span style="font-weight: bold;">drvsim_tutorial.bat. </span>has been created. Also the file <span style="font-weight: bold;">iodb_cfg_tutorial.txt </span>needs to be created, still starting from one already existing in the standalone folder. </p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_tutorial_new_sim_win_1" width="862" height="266" style="margin:0px auto 0px auto;width:862px;height:266px;border:none" src="drvsim_tutorial_new_sim_win_1.png"/></p>
<p class="p_Normal" style="text-align: center;">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Now a modification of the just created files is necessary. The <span style="font-weight: bold;">drvsim_tutorial.bat</span> file has to be modified only to use the <span style="font-weight: bold;">iodb_cfg_tutorial.txt</span> as configuration file; to do that, open the .bat file with a text editor and call the <span style="font-weight: bold;">iodb_cfg_tutorial.txt</span> as shown in the image below:</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_tutorial_new_sim_win_2" width="833" height="140" style="margin:0px auto 0px auto;width:833px;height:140px;border:none" src="drvsim_tutorial_new_sim_win_2.png"/></p>
<p class="p_Normal" style="text-align: center;">&nbsp;</p>
<p style="text-align: left; margin: 0px 0px 0px 24px;">The<span style="font-size: 8pt; font-weight: bold;"> </span><span style="font-weight: bold;">iodb_cfg_tutorial.txt</span> has to be modified in order to run all the modules needed by your specific simulation. As an example a test with the following modules is created:</p>
<p style="text-align: left; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">vicrt </span>- VI-CarRealTime solver;</p><p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">iodb_udp </span>- data streaming for VI-GraphSim;</p><p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">iodb_hwmap </span>- to manage the controllers of the simulator;</p><p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">iodb_elab </span>- for the EtherCAT communication;</p><p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 48px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">iodb_csv </span>- to log the data of the simulation, at 100 Hz.</p><p style="text-align: left; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p style="text-align: left; margin: 0px 0px 0px 24px;">The <span style="font-weight: bold;">iodb_cfg_tutorial.txt </span>file should be as shown below:</p>
<p style="text-align: left; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_tutorial_new_sim_win_3" width="834" height="183" style="margin:0px auto 0px auto;width:834px;height:183px;border:none" src="drvsim_tutorial_new_sim_win_3.png"/></p>
<p style="text-align: center; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p style="text-align: center; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p style="text-align: left; margin: 0px 0px 0px 24px;">Following is the explanation of every single row in the <span style="font-weight: bold;">iodb_cfg_tutorial.txt</span> file. </p>
<p style="text-align: center; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 24px;"><span class="f_CodeExample">vicrt&nbsp;1&nbsp;runvicrt.bat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;-&nbsp;run&nbsp;your&nbsp;.xml&nbsp;model</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 24px;"><span class="f_CodeExample">iodb_udp&nbsp;1&nbsp;iodb_udp.exe&nbsp;225.1.1.1&nbsp;127.0.0.1&nbsp;39766&nbsp;&nbsp;&nbsp;&lt;-&nbsp;datastream&nbsp;to&nbsp;VI-GraphSim,&nbsp;in&nbsp;this&nbsp;case&nbsp;127.0.0.1&nbsp;means&nbsp;that&nbsp;the&nbsp;streaming&nbsp;is&nbsp;to&nbsp;the&nbsp;Solver&nbsp;PC&nbsp;itself</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 24px;"><span class="f_CodeExample">iodb_hwmap&nbsp;1&nbsp;iodb_hwmap.exe &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;-&nbsp;map&nbsp;hardware&nbsp;Input&nbsp;and&nbsp;Outputs&nbsp;in&nbsp;the&nbsp;simulation</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 24px;"><span class="f_CodeExample">iodb_elab&nbsp;1&nbsp;iodb_elab.exe &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;-&nbsp;EtherCAT&nbsp;communication&nbsp;with&nbsp;Phase&nbsp;controller&nbsp;and&nbsp;I/O</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 24px;"><span class="f_CodeExample">iodb_csv&nbsp;10&nbsp;iodb_csv.exe &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;-&nbsp;.csv&nbsp;file&nbsp;logging</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 24px;"><span class="f_CodeExample">&nbsp;</span></p>
<p style="text-align: left; margin: 0px 0px 0px 24px;">Every row is associated to a module and uses the same syntax: </p>
<p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 24px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span>the first parameter is the module name you want to enable;</p><p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 24px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span>the second parameter is a number that tells the operating system how often to call this module (&quot;1&quot; means every millisecond, &quot;10&quot; means every 10 milliseconds);</p><p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 24px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span>the third parameter is the real executable or script associated with this module, that means the executable really doing the job;</p><p style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 24px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span>from the fourth parameter onwards all arguments are passed to the real executable to properly configure it: for this reason they are specific of each particular process; the only one using this parameters in our example is <span style="font-weight: bold;">iodb_udp.exe</span>.</p><p style="text-align: left; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p style="text-align: left; margin: 0px 0px 0px 24px;">Now all is configured to run your personal simulation in VI-DriveSim: recall the newly created <span style="font-weight: bold;">drvsim_tutorial.bat</span> file from the test list, save the configuration if you want VI-DriveSim to start with this test next time, and then press the start button.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_clip576b" width="973" height="247" style="margin:0px auto 0px auto;width:973px;height:247px;border:none" src="drvsim_clip576b.png"/></p>
<p style="text-align: center; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>
<p style="text-align: left; line-height: 1.0; white-space: nowrap; page-break-inside: avoid; margin: 0px 0px 0px 24px;"><span style="color: #000000;">&nbsp;</span></p>

<!--ZOOMSTOP-->
</div></div>
<script type="text/javascript"> 
<!-- 
var lastSlashPos = document.URL.lastIndexOf("/") >
document.URL.lastIndexOf("\\") ? document.URL.lastIndexOf("/") :
document.URL.lastIndexOf("\\");
if( document.URL.substring( lastSlashPos + 1, lastSlashPos + 4
).toLowerCase() != "~hh" )
{
    nsrInit();
}
--> 
</script> 
</body>
</html>
